package gov.nasa.anml.lifted;

import java.util.ArrayList;

import gov.nasa.anml.PDDL;
import gov.nasa.anml.PDDL.Action;
import gov.nasa.anml.PDDL.BooleanExpression;
import gov.nasa.anml.PDDL.Effect;
import gov.nasa.anml.PDDL.FloatExpression;
import gov.nasa.anml.PDDL.Parameter;
import gov.nasa.anml.PDDL.Predicate;
import gov.nasa.anml.utility.SimpleFloat;
import gov.nasa.anml.utility.SimpleInteger;

public class DegenerateInterval implements Interval {
	public Constant<SimpleFloat> time;
	public Constant<SimpleInteger> bra, ket;
	public Point[] pieces;
	

	public DegenerateInterval(Constant<SimpleFloat> t, int b, int k) {
		int l = k-b+1;
		pieces = new Point[l];
		for(int d=0;d<l;++d) {
			pieces[d] = new Point(t,b++);
		}
		time = t;
		setShape(b,k);
	}
	
	public AtomicTime getPiece(int k) {
		return pieces[k];
	}

	public Constant<SimpleFloat> getDuration() {
		return IntervalImp.constantDurationZero;
	}

	public Constant<SimpleFloat> getEnd() {
		return time;
	}

	public Constant<SimpleFloat> getStart() {
		return time;
	}

	public Constant<SimpleInteger> getBra() {
		return bra;
	}

	public Constant<SimpleInteger> getKet() {
		return ket;
	}

	public void setBra(Constant<SimpleInteger> bra) {
		this.bra = bra;
	}

	public void setKet(Constant<SimpleInteger> ket) {
		this.ket = ket;
	}

	public final void setShape(int b, int k) {
		setBra(b);
		setKet(k);
	}
	
	public void setBra(int b) {
		this.bra = IntervalImp.makeBra(b);
	}

	public void setKet(int k) {
		this.ket = IntervalImp.makeKet(k);
	}

	// TODO: all of the below
	public ArrayList<PDDL.BooleanExpression> getPDDLConditions() {
		return null;
	}

	public FloatExpression getPDDLDuration() {
		return null;
	}

	public ArrayList<Effect> getPDDLEffects() {
		return null;
	}

	public Predicate getPDDLExecuting() {
		return null;
	}

	public ArrayList<Parameter> getPDDLParameters() {
		return null;
	}

	public Action getPDDLAction() {
		return null;
	}

	public Predicate makePDDLExecuting() {
		return null;
	}

	
	
}
